import React from "react";
import { BrowserRouter, Routes, Route, Link } from "react-router-dom";
import TablePage from "./pages/Table";
import FormPage from "./pages/Form";
import ErrorBoundary from "./components/ErrorBoundary.jsx";

const App = () => (
  <ErrorBoundary>
    <BrowserRouter>
      <div>
        <nav>
          <Link to="/">Table</Link> |<Link to="/form">Form</Link> |
        </nav>
        <Routes>
          <Route path="/" element={<TablePage />} />
          <Route path="/form" element={<FormPage />} />
        </Routes>
      </div>
    </BrowserRouter>
  </ErrorBoundary>
);

export default App;
